# -*- coding: utf-8 -*-
# @Time : 2025/1/17 16:10
# @Author : debbyszhang
# @File : run.py
# @desc :
import os

import pytest

if __name__ == '__main__':
    # 指定要运行的测试文件
    test_files = [
        'testcases/user/edit_user.py',
        # 'testcases/cross/test_cross.py',
        'testcases/scenarios/login_test.py'
    ]

    # 将文件列表转换为pytest.main()需要的参数格式
    pytest_args = ['-vs', '--alluredir=./result/tmp', '--clean-alluredir'] + test_files

    # 执行pytest
    # pytest.main(pytest_args, confcutdir="testcases")
    pytest.main(pytest_args, )
    os.system('allure generate  ./result/tmp -o ./result/offline --clean --single-file')
    os.system('allure serve  ./result/tmp')

# pip freeze > requirements.txt
# pip install -r requirements.txt